3.213 \(\int \frac {\tan (e+f x)}{a+b \tan ^2(e+f x)} \, dx\)

Optimal. Leaf size=36 \[ -\frac {\log \left (a \cos ^2(e+f x)+b \sin ^2(e+f x)\right )}{2 f (a-b)} \]

[Out]

-1/2*ln(a*cos(f*x+e)^2+b*sin(f*x+e)^2)/(a-b)/f

________________________________________________________________________________________

Rubi [A]  time = 0.05, antiderivative size = 36, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.190, Rules used = {3670, 444, 36, 31} \[ -\frac {\log \left (a \cos ^2(e+f x)+b \sin ^2(e+f x)\right )}{2 f (a-b)} \]

Antiderivative was successfully verified.

[In]

Int[Tan[e + f*x]/(a + b*Tan[e + f*x]^2),x]

[Out]

-Log[a*Cos[e + f*x]^2 + b*Sin[e + f*x]^2]/(2*(a - b)*f)

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rule 36

Int[1/(((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))), x_Symbol] :> Dist[b/(b*c - a*d), Int[1/(a + b*x), x], x] -
Dist[d/(b*c - a*d), Int[1/(c + d*x), x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0]

Rule 444

Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_))^(q_.), x_Symbol] :> Dist[1/n, Subst[Int
[(a + b*x)^p*(c + d*x)^q, x], x, x^n], x] /; FreeQ[{a, b, c, d, m, n, p, q}, x] && NeQ[b*c - a*d, 0] && EqQ[m
- n + 1, 0]

Rule 3670

Int[((d_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_)])^(n_))^(p_.), x_Symbol]
 :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Dist[(c*ff)/f, Subst[Int[(((d*ff*x)/c)^m*(a + b*(ff*x)^n)^p)/(c^
2 + ff^2*x^2), x], x, (c*Tan[e + f*x])/ff], x]] /; FreeQ[{a, b, c, d, e, f, m, n, p}, x] && (IGtQ[p, 0] || EqQ
[n, 2] || EqQ[n, 4] || (IntegerQ[p] && RationalQ[n]))

Rubi steps

\begin {align*} \int \frac {\tan (e+f x)}{a+b \tan ^2(e+f x)} \, dx &=\frac {\operatorname {Subst}\left (\int \frac {x}{\left (1+x^2\right ) \left (a+b x^2\right )} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {\operatorname {Subst}\left (\int \frac {1}{(1+x) (a+b x)} \, dx,x,\tan ^2(e+f x)\right )}{2 f}\\ &=\frac {\operatorname {Subst}\left (\int \frac {1}{1+x} \, dx,x,\tan ^2(e+f x)\right )}{2 (a-b) f}-\frac {b \operatorname {Subst}\left (\int \frac {1}{a+b x} \, dx,x,\tan ^2(e+f x)\right )}{2 (a-b) f}\\ &=-\frac {\log (\cos (e+f x))}{(a-b) f}-\frac {\log \left (a+b \tan ^2(e+f x)\right )}{2 (a-b) f}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.04, size = 37, normalized size = 1.03 \[ -\frac {\log \left (a+b \tan ^2(e+f x)\right )+2 \log (\cos (e+f x))}{2 f (a-b)} \]

Antiderivative was successfully verified.

[In]

Integrate[Tan[e + f*x]/(a + b*Tan[e + f*x]^2),x]

[Out]

-1/2*(2*Log[Cos[e + f*x]] + Log[a + b*Tan[e + f*x]^2])/((a - b)*f)

________________________________________________________________________________________

fricas [A]  time = 0.43, size = 38, normalized size = 1.06 \[ -\frac {\log \left (\frac {b \tan \left (f x + e\right )^{2} + a}{\tan \left (f x + e\right )^{2} + 1}\right )}{2 \, {\left (a - b\right )} f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(f*x+e)/(a+b*tan(f*x+e)^2),x, algorithm="fricas")

[Out]

-1/2*log((b*tan(f*x + e)^2 + a)/(tan(f*x + e)^2 + 1))/((a - b)*f)

________________________________________________________________________________________

giac [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: NotImplementedError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(f*x+e)/(a+b*tan(f*x+e)^2),x, algorithm="giac")

[Out]

Exception raised: NotImplementedError >> Unable to parse Giac output: Unable to check sign: (2*pi/x/2)>(-2*pi/
x/2)2/f*(1/(2*a-2*b)*ln(abs((1-cos(f*x+exp(1)))/(1+cos(f*x+exp(1)))+1))-1/(4*a-4*b)*ln(((1-cos(f*x+exp(1)))/(1
+cos(f*x+exp(1))))^2*a-2*(1-cos(f*x+exp(1)))/(1+cos(f*x+exp(1)))*a+4*(1-cos(f*x+exp(1)))/(1+cos(f*x+exp(1)))*b
+a))

________________________________________________________________________________________

maple [A]  time = 0.19, size = 50, normalized size = 1.39 \[ -\frac {\ln \left (a +b \left (\tan ^{2}\left (f x +e \right )\right )\right )}{2 f \left (a -b \right )}+\frac {\ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2 f \left (a -b \right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(f*x+e)/(a+b*tan(f*x+e)^2),x)

[Out]

-1/2/f/(a-b)*ln(a+b*tan(f*x+e)^2)+1/2/f/(a-b)*ln(1+tan(f*x+e)^2)

________________________________________________________________________________________

maxima [A]  time = 0.31, size = 30, normalized size = 0.83 \[ -\frac {\log \left (-{\left (a - b\right )} \sin \left (f x + e\right )^{2} + a\right )}{2 \, {\left (a - b\right )} f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(f*x+e)/(a+b*tan(f*x+e)^2),x, algorithm="maxima")

[Out]

-1/2*log(-(a - b)*sin(f*x + e)^2 + a)/((a - b)*f)

________________________________________________________________________________________

mupad [B]  time = 11.85, size = 66, normalized size = 1.83 \[ -\frac {\mathrm {atan}\left (\frac {a\,{\mathrm {tan}\left (e+f\,x\right )}^2\,1{}\mathrm {i}-b\,{\mathrm {tan}\left (e+f\,x\right )}^2\,1{}\mathrm {i}}{2\,a+a\,{\mathrm {tan}\left (e+f\,x\right )}^2+b\,{\mathrm {tan}\left (e+f\,x\right )}^2}\right )\,1{}\mathrm {i}}{f\,\left (a-b\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(e + f*x)/(a + b*tan(e + f*x)^2),x)

[Out]

-(atan((a*tan(e + f*x)^2*1i - b*tan(e + f*x)^2*1i)/(2*a + a*tan(e + f*x)^2 + b*tan(e + f*x)^2))*1i)/(f*(a - b)
)

________________________________________________________________________________________

sympy [A]  time = 2.11, size = 143, normalized size = 3.97 \[ \begin {cases} \frac {\tilde {\infty } x}{\tan {\relax (e )}} & \text {for}\: a = 0 \wedge b = 0 \wedge f = 0 \\\frac {\log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 a f} & \text {for}\: b = 0 \\- \frac {1}{2 b f \tan ^{2}{\left (e + f x \right )} + 2 b f} & \text {for}\: a = b \\\frac {x \tan {\relax (e )}}{a + b \tan ^{2}{\relax (e )}} & \text {for}\: f = 0 \\- \frac {\log {\left (- i \sqrt {a} \sqrt {\frac {1}{b}} + \tan {\left (e + f x \right )} \right )}}{2 a f - 2 b f} - \frac {\log {\left (i \sqrt {a} \sqrt {\frac {1}{b}} + \tan {\left (e + f x \right )} \right )}}{2 a f - 2 b f} + \frac {\log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 a f - 2 b f} & \text {otherwise} \end {cases} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(f*x+e)/(a+b*tan(f*x+e)**2),x)

[Out]

Piecewise((zoo*x/tan(e), Eq(a, 0) & Eq(b, 0) & Eq(f, 0)), (log(tan(e + f*x)**2 + 1)/(2*a*f), Eq(b, 0)), (-1/(2
*b*f*tan(e + f*x)**2 + 2*b*f), Eq(a, b)), (x*tan(e)/(a + b*tan(e)**2), Eq(f, 0)), (-log(-I*sqrt(a)*sqrt(1/b) +
 tan(e + f*x))/(2*a*f - 2*b*f) - log(I*sqrt(a)*sqrt(1/b) + tan(e + f*x))/(2*a*f - 2*b*f) + log(tan(e + f*x)**2
 + 1)/(2*a*f - 2*b*f), True))

________________________________________________________________________________________